package com.w2cx.selenium.page;

import com.w2cx.selenium.base.DriverBase;
import com.w2cx.selenium.util.Locator;
import org.openqa.selenium.WebElement;

import java.util.List;

public class PoiLibrManaPage extends BasePage {

    DriverBase driver;
    public PoiLibrManaPage(DriverBase driver){
        super(driver);
    }

    //获取“基础数据管理”菜单
    public WebElement getBaseDataManageMenu(){
        List<WebElement> list = elements(Locator.getByLocator("firstMenuList"));
        WebElement element = list.get(3);
        System.out.println("找到元素:"+element.getText());
        return element;
    }

    //获取“POI库管理”菜单
    public WebElement getPoiLibraryManageMenu(){
        List<WebElement> list = elements(Locator.getByLocator("BaseDataSecondMenu"));
        WebElement element = list.get(4);
        System.out.println("找到元素:"+element.getText());
        return element;
    }


    //获取“添加poi”按钮
    public WebElement getAddPoiBtn(){
        WebElement element = element(Locator.getByLocator("addPoiBtn"));
        System.out.println("找到元素:"+element.getText());
        return element;
    }

    //获取“poi分类”下拉框
    public WebElement getPoiCategory(){
        List<WebElement> list = elements(Locator.getByLocator("poiCategory"));
        WebElement element = list.get(0);
        System.out.println("找到元素:"+element.getText());
        return element;
    }

    //获取poi分类选项
    public WebElement getPoiCateSelect(){
        WebElement element = element(Locator.getByLocator("selectPoiCate"));
        System.out.println("找到元素:"+element.getText());
        return element;
    }


    //获取poi名称输入框
    public WebElement getPoiNameInput(){
        WebElement element = element(Locator.getByLocator("poiNameInput1"));
        System.out.println("找到元素:"+element.getText());
        return element;
    }


    //获取“添加图片”按钮
    public WebElement getAddImgBtn(){
        WebElement element = element(Locator.getByLocator("addImageBtn"));
        System.out.println("找到元素:"+element.getText());
        return element;
    }


    //获取“添加定位”输入框
    public WebElement getAddLocationInput(){
        WebElement element = element(Locator.getByLocator("addLocationInput"));
        System.out.println("找到元素:"+element.getText());
        return element;
    }

    //获取“定位”按钮
    public WebElement getLocationBtn(){
        WebElement element = element(Locator.getByLocator("locationBtn"));
        System.out.println("找到元素:"+element.getText());
        return element;
    }

    //获取“保存”按钮
    public WebElement getSavePoiBtn(){
        WebElement element = element(Locator.getByLocator("poiAddBtn1"));
        System.out.println("找到元素:"+element.getText());
        return element;
    }


    //获取poi库管理列表中第一行poi名称
    public WebElement getFirstPoiName(){
        WebElement element = element(Locator.getByLocator("poiName"));
        return element;
    }



}
